package com.kc.gb.device.controller;

import com.kc.gb.base.dto.Result;
import com.kc.gb.device.service.CameraAdminService;
import com.kc.gb.device.service.support.dto.CameraMockDto;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/admin/device/camera")
public class CameraAdminController {

    @Resource
    CameraAdminService cameraAdminService;

    /**
     * 获取设备码
     * @return
     */
    @PostMapping(path = "/mock/report")
    private Result<?> mockReport(@RequestBody CameraMockDto mock) {
        try {
            cameraAdminService.report(mock);
            return Result.success(mock.getMessage());
        } catch (Exception e) {
            return Result.fail(e.getMessage());
        }
    }
}
